import openai
from openai import OpenAI

# mpaonggrodubi25@outlook.com----nstzmqzl45----sk-11-XR5Ivtd83WKOB7uiIx6zT3BlbkFJqsNMSx4Dk9jtwbRKxayr
# GregorioMartinez6133@outlook.com----i4We0Uc6Sa2QxfF----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    微软授权登录

api_key='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'

def demo():
  client = OpenAI(api_key=api_key)

  response = client.chat.completions.create(
  model="gpt-4o",
  messages=[
    {
      "role": "system",
      "content": "你会收到一个问题，给出解题思格和结果"
    },
    {
      "role": "user",
      "content": "从51个数字中选会大小排在第25位的数"
    }
  ],
  temperature=0.8,
  max_tokens=1024,
  top_p=1
  )
  
  print(response)
  print(response.choices[0].message.content)

if __name__ == "__main__":
    demo()